home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- Appearance = 0 'Flat
- BorderStyle = 3 'Fixed Dialog
- Caption = "Wave VBX Loop Sample"
- ClientHeight = 2985
- ClientLeft = 1650
- ClientTop = 1920
- ClientWidth = 4095
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 3390
- Left = 1590
- LinkTopic = "Form1"
- ScaleHeight = 2985
- ScaleWidth = 4095
- Top = 1575
- Width = 4215
- Begin VB.CheckBox chkLoop
- Caption = "Continuous Playing (Loop)"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 240
- TabIndex = 6
- Top = 1200
- Width = 3615
- End
- Begin VB.CheckBox chkExclusive
- Caption = "Exclusive Playing"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 255
- Left = 240
- TabIndex = 5
- Top = 840
- Width = 3615
- End
- Begin VB.TextBox txtFilename
- Appearance = 0 'Flat
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 285
- Left = 240
- TabIndex = 2
- Text = "C:\WINDOWS\RINGIN.WAV"
- Top = 480
- Width = 3615
- End
- Begin VB.CommandButton btnStop
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Stop"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 2160
- TabIndex = 1
- Top = 2400
- Width = 1575
- End
- Begin VB.CommandButton btnPlay
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Play"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 360
- TabIndex = 0
- Top = 2400
- Width = 1575
- End
- Begin WaveLib.Wave Wave1
- Left = 3360
- Top = 0
- _version = 65537
- _extentx = 847
- _extenty = 847
- _stockprops = 64
- exclusive = 0 'False
- filename = ""
- filelength = 0
- loop = 0 'False
- playend = -1
- playstart = -1
- End
- Begin VB.Label Label2
- Alignment = 2 'Center
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- BackStyle = 0 'Transparent
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 240
- TabIndex = 4
- Top = 1680
- Width = 3615
- End
- Begin VB.Label Label1
- Appearance = 0 'Flat
- Caption = "Filename:"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 240
- TabIndex = 3
- Top = 240
- Width = 1935
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim fChanged As Integer ' flag: has filename changed?
- Private Sub btnPlay_Click()
- ' make sure the filename is up to date
- SetFilename
- ' play the file
- Wave1.Action = 1
- EnableButtons
- Label2 = "Playing"
- End Sub
- Private Sub btnStop_Click()
- ' stop playing
- Wave1.Action = 4
- ' update buttons
- EnableButtons
- End Sub
- Private Sub chkExclusive_Click()
- Wave1.Exclusive = (chkExclusive.Value <> 0)
- End Sub
- Private Sub chkLoop_Click()
- Wave1.Loop = (chkLoop.Value <> 0)
- End Sub
- Private Sub EnableButtons()
- ' set button status
- Select Case Wave1.Status
- Case 1: ' playing
- btnStop.Enabled = True
- Case 4: ' stopped
- btnStop.Enabled = False
- End Select
- End Sub
- Private Sub Form_Load()
- fChanged = True
- EnableButtons
- End Sub
- Private Sub SetFilename()
- ' if the filename has changed, tell Wave VBX
- If fChanged Then
- ' changed no more
- fChanged = False
- Wave1.filename = txtFilename
- End If
- End Sub
- Private Sub txtFilename_Change()
- fChanged = True
- End Sub
- Private Sub Wave1_PlayDone()
- EnableButtons
- Label2 = "Stopped"
- End Sub
- Private Sub Wave1_PlayLoop(LoopCount As Integer)
- Label2 = "Playing (" & LoopCount & " times)"
- End Sub
-